The following relates to the digital image arts. It particularly relates to identifying whether an image history includes a JPEG compression stage, and will be described with particular reference thereto. However, the following is also applicable to determining the JPEG quality or extent of JPEG compression employed during the JPEG compression stage or stages of the image history, and to other like applications.
Digital images are stored in various formats, including for example GIF, JPEG, TIFF, PCX, BMP, PNG, and so forth. Each format has its own advantages and disadvantages. For example, some formats are proprietary and may require licensing. Digital image formats can employ either lossless or lossy compression, or no compression whatsoever. Thus, selection of digital image format also entails balancing image quality versus file size. An image can also change its format along its lifecycle. For example, an image acquired in one format can be converted to a different format for storage, or an image can be converted to a different format for insertion into a printing data stream, or so forth.
JPEG is an open format developed by the Joint Pictures Expert Group (the JPEG image format is named after the acronym of its creating group). The JPEG format is the most common image format used for digital image storage and distribution. For example, it has been estimated that approximately 60% of images on the Internet are in JPEG format. A majority of digital cameras, scanners, cellphone cameras, and other consumer electronics for generating digital images provide output in JPEG format.
JPEG employs lossy compression. A typical JPEG compression sequence includes: (i) transformation of the image to a luminance/chrominance color space such as YUV, YIQ, or so forth; optional down-sampling typically applied to the chrominance components; blocking of pixels into 8×8 pixel blocks or otherwise-sized blocks; transforming each component within each block using a discrete cosine transform (DCT) to convert to spatial frequencies; quantization of the frequencies to scaled integer values to provide a first, lossy level of compression; performing a second, typically lossless level of compression using Huffman coding, arithmetic coding, or so forth; and construction of suitable file headers containing quantization tables, Huffman coding tables, or other information employed in subsequent image decompression.
The amount of loss in the JPEG compression is generally related to the coarseness or fineness of the quantization. Using large quantization coefficients followed by rounding off to the nearest integer causes large rounding errors and substantial information loss. By comparison, using smaller quantization coefficients for compressing the same image, followed by rounding, causes smaller rounding errors and less information loss. Because the visual image quality is typically more strongly influenced by luminance than by chrominance, larger quantization coefficients are typically used in quantization of the chrominance components as compared with the luminance component. Typically, photo editing software and consumer products provide the user with “image quality” parameters for selecting the quantization coefficients. For example, a “high image quality” mode will use generally smaller quantization coefficients versus a “low image quality” mode.
After JPEG compression, the image may be stored as a JPEG file, or may be converted to another image format. Such image format conversion retains the information loss introduced by the lossy JPEG compression. Moreover, a digital image may be JPEG compressed, then uncompressed and communicated through a printing pipeline or other data transmission pathway in which the digital image loses its identity as a named file of the JPEG type. In such cases, it is not clear whether the digital image has undergone JPEG compression at some point in its history.
There are advantages to knowing whether a digital image has undergone JPEG compression at some point in its history. For example, image quality can be improved by smoothing or otherwise mitigating image artifacts introduced by the lossy JPEG compression. However, image processing techniques that are advantageous for reducing JPEG artifacts can degrade image quality when applied to an image that has never undergone JPEG compression.
Another advantage to knowing whether an image has undergone JPEG compression is that the image quality of the compressed JPEG format provides a baseline image quality for later compression and image storage operations. If an image is known to have undergone JPEG compression of a certain JPEG quality, then the image can be re-compressed at least to that JPEG quality level with substantially no further image quality degradation. Thus, knowledge of the JPEG compression history enables selection of an optimal compression level for later image processing.
Yet another advantage to knowing the JPEG compression history, if any, of a digital image relates to image history estimation. Estimating an image history is advantageous for efficient image storage and retrieval, and is also advantageous from an intellectual property standpoint.
Although it is useful to know whether an image has undergone JPEG compression, making that determination for a particular digital image can be difficult when the digital image is in a non-JPEG format, is part of a print data stream, or so forth. It is difficult to determine whether a presently non-JPEG image has in the past undergone JPEG compression. The difficulty in making this determination increases when the image has undergone post-conversion processing such as cropping, re-sizing, printing followed by optical scanning, or so forth. Although such a converted (and possibly post-conversion-processed) digital image is no longer in JPEG format, it generally retains image artifacts introduced by the JPEG compression.